package chapter6.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import chapter6.entity.Customer;
@Controller
public class CustomerController_ch63 {
    /*
     * 接收页面请求的JSON数据，并返回JSON格式结果
     */
    @RequestMapping("/testJson")
    @ResponseBody
    public Customer testJson(@RequestBody Customer cust) {
        // 打印接收的JSON格式数据
        System.out.println(cust);
        // 返回JSON格式的响应
        return cust;
    }
}
